//
//  SchoolAPI.swift
//  LeGou
//
//  Created by 刘亿前 on 2022/10/14.
//

import Foundation

enum SchoolAPI {
    // 分类
    case school_cate
    // 列表
    case school_list(_ param: [String: Any])
    // 详情
    case school_detail(_ param: [String: Any])
}

extension SchoolAPI: ZMApiProvider {
    func BaseUrl() -> String {
        return baseUrl
    }
    
    func urlAndMthodAndParam() -> (url: String, method: ZMHTTPMethod, params: [String : Any], body: Bool) {
        switch self {
        case .school_cate:
            return ("/api/front/tb/goods/getCid", .get, [:], false)
        case .school_list(let pa):
            return ("/api/front/tb/goods/hot", .get, pa, false)
        case .school_detail(let pa):
            return ("/api/front/jd/jdGoodsDetails", .get, pa, false)
        }
    }
    
    func HTTPHeader() -> ZMHTTPHeaders? {
        return AppHelper.reqeustHeader()
    }
    
    func UpLoadData() -> [Data]? {
        return nil
    }
    
    func singleRequest() -> Bool {
        switch self {
//            case .power_order_list:
//                return true
            default:
                return false
        }
    }
}

